import ch.qos.logback.core.encoder.ByteArrayUtil;
import io.netty.buffer.ByteBufUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author: xinmi
 * @date: 2020/11/6
 * @description:
 */
public class Crc {

    private static Logger LOG = LoggerFactory.getLogger(Crc.class);

   public static void main(String argv[])
   {
       byte[] crcContent = ByteArrayUtil.hexStringToByteArray("000000480000005210010001E24001000100000000000001E2407465737438303900312E37312E3132392E32303100000000000000000000000000000000000000004E8E");

       int crcValue = CRC16CCITT.getCRC16(crcContent);

       LOG.info("crcValue = " +  ByteBufUtil.hexDump(CommonUtils.short2Bytes((short)crcValue)));



   }
}
